package com.stylefeng.guns.modular.wz.warpper;

import com.stylefeng.guns.common.constant.Consts;
import com.stylefeng.guns.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;

import java.util.List;
import java.util.Map;

/**
 * @program: guns
 * @description: 奖品包装类
 * @author: Chenchao
 * @create: 2018-03-29 10:02
 **/
public class WzPrizeWarpper extends BaseControllerWarpper {
    public WzPrizeWarpper(List<Map<String, Object>> list) {
        super(list);
    }


    @Override
    protected void warpTheMap(Map<String, Object> map) {
        map.put("label", ConstantFactory.me().getDictsByName("奖品标签",Integer.parseInt(map.get("label").toString())));
        map.put("type", ConstantFactory.me().getDictsByName("奖品类型",Integer.parseInt(map.get("type").toString())));
        map.put("subtype", ConstantFactory.me().getDictsByName("奖品子类型",Integer.parseInt(map.get("subtype").toString())));
        map.put("status", ConstantFactory.me().getDictsByName("奖品状态",Integer.parseInt(map.get("status").toString())));
        map.put("coverUrl", Consts.DOMAIN+map.get("coverUrl"));
        map.put("payAmount", Integer.parseInt(map.get("payAmount").toString())*0.01);
        map.put("exchangeAmount", Integer.parseInt(map.get("exchangeAmount").toString())*0.01);
    }
}
